Telegram Group & Telegram Channel
Как перевернуть список в Python с помощью функции reversed()

Функция reversed() принимает список в качестве аргумента и возвращает нам исходные элементы, только в обратном порядке.

Если вы хотите сохранить возвращаемое значение из функции reversed() для дальнейшего использования, то нужно преобразовать результат в список с помощью функции list(). Далее необходимо присвоить получившееся выражение переменной, в нашем случае my_new_list.



tg-me.com/pythonist24/1485
Create:
Last Update:

Как перевернуть список в Python с помощью функции reversed()

Функция reversed() принимает список в качестве аргумента и возвращает нам исходные элементы, только в обратном порядке.

Если вы хотите сохранить возвращаемое значение из функции reversed() для дальнейшего использования, то нужно преобразовать результат в список с помощью функции list(). Далее необходимо присвоить получившееся выражение переменной, в нашем случае my_new_list.

BY Python обучающий




Share with your friend now:
tg-me.com/pythonist24/1485

View MORE
Open in Telegram


Python обучающий Telegram | DID YOU KNOW?

Date: |

The Singapore stock market has alternated between positive and negative finishes through the last five trading days since the end of the two-day winning streak in which it had added more than a dozen points or 0.4 percent. The Straits Times Index now sits just above the 3,060-point plateau and it's likely to see a narrow trading range on Monday.

What Is Bitcoin?

Bitcoin is a decentralized digital currency that you can buy, sell and exchange directly, without an intermediary like a bank. Bitcoin’s creator, Satoshi Nakamoto, originally described the need for “an electronic payment system based on cryptographic proof instead of trust.” Each and every Bitcoin transaction that’s ever been made exists on a public ledger accessible to everyone, making transactions hard to reverse and difficult to fake. That’s by design: Core to their decentralized nature, Bitcoins aren’t backed by the government or any issuing institution, and there’s nothing to guarantee their value besides the proof baked in the heart of the system. “The reason why it’s worth money is simply because we, as people, decided it has value—same as gold,” says Anton Mozgovoy, co-founder & CEO of digital financial service company Holyheld.

Python обучающий from tr


Telegram Python обучающий
FROM USA